package com.example.memory.controller;

import com.example.memory.base.controller.BaseController;
import com.example.memory.base.entity.ResultMsg;
import com.example.memory.entity.Content;
import com.example.memory.servicde.ContentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/content")
public class ContentController extends BaseController<Content> {

    @Resource
    ContentService contentService;

    @GetMapping("/getYear")
    public ResultMsg getYear() {
        List<String> list = contentService.getYear();
        return ResultMsg.success(list);
    }

    @GetMapping("/getDay")
    public ResultMsg getDay(String year) {
        List<String> list = contentService.getDay(year);
        return ResultMsg.success(list);
    }

    @GetMapping("/getDayList")
    public Object getDayList(Content content) {
        return contentService.getDayList(content);
    }
}
